package com.restaurant.springboot.controller;


import com.restaurant.springboot.entity.DishesEntity;
import com.restaurant.springboot.service.DishesService;
import com.restaurant.springboot.utils.RespCode;
import com.restaurant.springboot.utils.RespEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author jack
 * @Date:2019/7/29 14:17
 */
@RestController
@RequestMapping("/api/recommend")
public class RecommendController {

    @Autowired
    DishesService dishesService;

    @GetMapping("")
    public RespEntity getAllRecommendDishes(){
        List<DishesEntity> recommendDishes = dishesService.getRecommendDishes();
        return new RespEntity(
                RespCode.SUCCESS,
                recommendDishes
        );
    }
}
